|
Introduction
|
The Music Object class supplies several methods with which to register callback functions that are to be executed when certain events occur in a Music Object instance's player. For full details on the callback methods and their syntax, see the Callbacks section of the Music Object reference. To summarize, the methods are...
It is important to bear in mind that the onPause, onPlay, and onStop callbacks get called irrespective of whether the user triggers an event by using the control panel's transport controls, or the player is sent a transport control type instruction through Music Object scripting. Also, an event such as onStop will also be triggered if a file, that is not set to loop, plays itself out and naturally reaches its end. So, whatever initiates one of these types of events in the player, the callback will still be executed.
When a Music Object instance is first created, there are by default no functions registered to handle the callbacks. Consequently, when one of the events described above occurs within the player, nothing will happen. Using the callback registering methods you can set up callback handlers for any or all of the possible callback events.